from gpiozero import Servo
from time import sleep

servo = Servo(2)


servo.min()
sleep(1)
servo.max()
sleep(1)